[Unit]
Description=Elasticsearch
Wants=network-online.target
After=network-online.target

[Service]
User={{ elk_user }}
Group={{ elk_user }}

WorkingDirectory={{ elk_path.apps }}/elasticsearch
ExecStart={{ elk_path.apps }}/elasticsearch/bin/elasticsearch --pidfile {{ elk_path.logs }}/elasticsearch/elasticsearch.pid --quiet
PIDFile={{ elk_path.logs }}/elasticsearch/elasticsearch.pid
PrivateTmp=true

LimitNOFILE=262144
LimitNPROC=4096
LimitAS=infinity
LimitFSIZE=infinity
LimitMEMLOCK=infinity

TimeoutStopSec=900
TimeoutStartSec=900

[Install]
WantedBy=multi-user.target
